<template>
	<view class="wrap">
		<slideCode ref="slidecode" :modelValue="slideCodeObj" @success="onSuccess"></slideCode>
		<view class="content">
			<view class="content_img">
				<image :src="imgurl + '17.png'" mode="aspectFill"></image>
			</view>
			<view class="message" v-if="message">{{message}}</view>
			<view class="content_text">
				继续查询 请点击
			</view>
			<view class="content_btn" @click="$u.route('/pages/tabbar/index')">
				继续扫码
			</view>
		</view>
	</view>
</template>

<script>
	import slideCode from '@/uni_modules/xlg-slideCode_0.0.6/xlg_slideCode/xlg_slideCode.vue'
	export default {
		components: {
			slideCode
		},
		data() {
			return {
				message: '',
				slideCodeObj: {},
			};
		},
		onLoad(opition) {
			if (opition) {
				this.message = opition.message
				if (this.message.includes('请确认验证码')) {
					this.slideCodeObj = {
						class: '',
						show: true
					}
				}
			}
		},
		methods: {
			onSuccess() {
				this.message = '已完成验证'
				console.log('验证通过')
			},
			chooseImage() {
				this.$u.route('pages/scans/errorCorrection')
				// uni.chooseImage({
				// 	count: 6,
				// 	sizeType: ['original', 'compressed'],
				// 	sourceType: ['album'],
				// 	success: function(res) {
				// 		// 预览图片
				// 		uni.previewImage({
				// 			urls: res.tempFilePaths,
				// 			longPressActions: {
				// 				itemList: ['发送给朋友', '保存图片', '收藏'],
				// 				success: function(data) {
				// 					console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data
				// 						.index + 1) + '张图片');
				// 				},
				// 				fail: function(err) {
				// 					console.log(err.errMsg);
				// 				}
				// 			}
				// 		});
				// 	}
				// });
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wrap {
		width: 750rpx;
		padding-top: 125rpx;

		.content {

			.content_img {
				margin: 0 auto;
				width: 160rpx;
				height: 178rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.content_text {
				margin-top: 96rpx;
				font-size: 24rpx;
				text-align: center;
				color: #434242;
			}

			.message {
				font-size: 32rpx;
				text-align: center;
				color: #434242;
				font-weight: 700;
				line-height: 120rpx;
			}

			.content_btn {
				margin: 30rpx auto 0;
				width: 586rpx;
				height: 100rpx;
				background: #2767E6;
				border-radius: 50rpx;
				box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0, 185, 255, 0.20);
				font-size: 30rpx;
				line-height: 100rpx;
				font-weight: bold;
				text-align: center;
				color: #ffffff;
			}

			.content_btn_a {
				margin: 30rpx auto 0;
				width: 586rpx;
				height: 100rpx;
				background: #ffffff;
				border: 1rpx solid #2767E6;
				border-radius: 50rpx;
				box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0, 185, 255, 0.20);
				font-size: 30rpx;
				line-height: 100rpx;
				font-weight: bold;
				text-align: center;
				color: #2767E6;
			}
		}
	}
</style>